package com.wangzy.game;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;

/**
 * @ProjectName: SportBS
 * @Date: 2023/1/18
 * @Desc:道具
 */
public class BaseProp extends Sprite{

    private int step;

    public BaseProp(Bitmap frame1, Point point, BaseGameScene gameScene) {
        super(frame1, point, gameScene);
    }

    public BaseProp(Bitmap frame1, Point point, BaseGameScene gameScene, int type) {
        super(frame1, point, gameScene, type);
    }

    public BaseProp(Point point, BaseGameScene gameScene, Bitmap... frames) {
        super(point, gameScene, frames);
    }

    public BaseProp(BaseGameScene gameScene, Bitmap... frames) {
        super(gameScene, frames);
    }





    @Override
    public void update(Canvas canvas, Paint paint) {
        updatePostion();
        super.update(canvas, paint);
    }

    public void updatePostion() {
        this.point.y = (int) (this.point.y + step+(step*gameScene.getStepGain()));
    }

    public int getStep() {
        return step;
    }

    public void setStep(int step) {
        this.step = step;
    }
}